const getUserInfo = async (id, display_id) => {
	return new Promise(async (resolve, reject) => {
		try {
			if (!tikTokCookie) return resolve();
			log.info('https://www.tiktok.com/@' + display_id);
			const result = await axios.get('https://www.tiktok.com/@' + display_id, {
				headers: {
					'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36',
					cookie: tikTokCookie,
				},
				timeout: 10000,
			});
			const $ = cheerio.load(result.data);
			const scriptTag = $('script#\\__UNIVERSAL_DATA_FOR_REHYDRATION__').html();
			if (JSON.parse(scriptTag).__DEFAULT_SCOPE__['webapp.user-detail'].statusMsg == 'user banned' || JSON.parse(scriptTag).__DEFAULT_SCOPE__['webapp.user-detail'].statusCode != 0) {
				await userDB.batchDelete([id]);
				return resolve();
			}
			log.info('获取地区国家成功');
			let country = JSON.parse(scriptTag).__DEFAULT_SCOPE__['webapp.user-detail'].userInfo.user.region;
			await userDB.batchUpdateById([id], { country: country, region: country });
			resolve();
		} catch (error) {
			log.error(`获取地区国家错误:${error}`);
			await userDB.batchDelete([id]);
			resolve();
		}
	});
};
